Missing ModuleMap with Docbuild

When performing xcodebuild docbuild I'm getting an error that I'm missing a module map for one of my Swift Packages I've included in the project. This is because I want to build the docbuild for iOS only, but have the Swift Package as a macOS only import

fatal error: module map file '/Users/administrator/Library/Developer/Xcode/DerivedData/AppName/Build/Intermediates.noindex/Build/Intermediates.noindex/GeneratedModuleMaps-iphoneos/SQLite.modulemap' not found

The docbuild is as follows

xcodebuild docbuild \
	-scheme *** \
    -derivedDataPath ${DD_LOCATION} \
    -configuration Release \
	-sdk iphoneos \
	SKIP_INSTALL=NO \
    BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
    BUILD_DIR=${WORKSPACE}/build \
    DEVELOPMENT_TEAM=*** \

The Swift package mentioned is added as macOS only with an optional linkage

and I have excluded the paths from source files which makes me able to run the app via xcode.

Is there anything else I should be doing to exclude this from being added to the iOS side of our project? Thanks in advance for any help.

I'm posting on here as this is generic for any Swift Packages which support iOS and macOS but important as a single OS package.

Missing ModuleMap with Docbuild
 
 
Q